package cn.mofei.spring_aop;

import cn.mofei.spring_aop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@SpringBootApplication
@Controller
public class SpringAopApplication {
    @Autowired
    private UserService userService;

    @RequestMapping(value = "/say_hello")
    @ResponseBody
    public void sayHello(){
         userService.sayHello();
    }

    public static void main(String[] args) {
        SpringApplication.run(SpringAopApplication.class, args);
    }

}
